package com.lecyon.farm.vo.modify;

import com.lecyon.farm.base.BaseVo;
import com.lecyon.farm.common.constant.CommonConstant;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;

/**
 * 修改登录密码
 *
 * @author Yao Zheng
 * @Date 2019/9/11 22:14
 */
@ApiModel("修改登录密码Vo")
@Data
public class ModifyLoginPassword extends BaseVo {

    @ApiModelProperty(name = "user_id", value = "用户id")
    @Min(value = 1, message = "用户ID无效")
    private Long userId;

    @ApiModelProperty(name = "currentPassword", value = "当前密码", required = true)
    @NotBlank(message = "请输入当前密码")
    @Length(min = CommonConstant.MIN_LENGTH_FIELD, max = CommonConstant.MAX_LENGTH_FIELD, message = "密码长度必须在{min} ~ {max}之间")
    private String currentPassword;

    @ApiModelProperty(name = "password", value = "密码", required = true)
    @NotBlank(message = "密码不能为空")
    @Length(min = CommonConstant.MIN_LENGTH_FIELD, max = CommonConstant.MAX_LENGTH_FIELD, message = "密码长度必须在{min} ~ {max}之间")
    private String password;

    @ApiModelProperty(name = "confirmPassword", value = "确认密码", required = true)
    @NotBlank(message = "两次输入要一致")
    @Length(min = CommonConstant.MIN_LENGTH_FIELD, max = CommonConstant.MAX_LENGTH_FIELD, message = "确认密码长度必须在{min} ~ {max}之间")
    private String confirmPassword;

}
